var e = require("../../@babel/runtime/helpers/interopRequireDefault"), t = e(require("../../@babel/runtime/regenerator")), r = require("../../@babel/runtime/helpers/asyncToGenerator"), s = e(require("../../http/system")), a = require("../../utils/tool"), n = new s.default();

Component({
    data: {
        show: !1,
        rules: "",
        isAgree: !1
    },
    attached: function() {
        this.getAgreement();
    },
    methods: {
        agree: function(e) {
            console.log(e), this.setData({
                isAgree: e.detail.select
            });
        },
        showPopup: function() {
            this.setData({
                show: !0
            }), this.triggerEvent("changeScroll", {});
        },
        onClose: function() {
            this.setData({
                show: !1
            }), this.triggerEvent("changeScroll", {});
        },
        close: function() {
            this.setData({
                show: !1
            });
        },
        toAddress: function() {
            this.data.isAgree ? (wx.navigateTo({
                url: "/pages/edit_address/edit_address"
            }), this.close()) : (0, a.toastToPage)("请先勾选发货协议");
        },
        getAgreement: function() {
            var e = this;
            return r(t.default.mark(function r() {
                var s;
                return t.default.wrap(function(t) {
                    for (;;) switch (t.prev = t.next) {
                      case 0:
                        return t.next = 2, n.getSystemConfig("deliveryAgreement");

                      case 2:
                        s = t.sent, e.setData({
                            rules: s.data.configValue
                        });

                      case 4:
                      case "end":
                        return t.stop();
                    }
                }, r);
            }))();
        }
    }
});